<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
		<style>.empty{top: 69px;}</style>
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop zizh_rtop">
						<span class="title">子账号管理</span>
					</div>
					<div class="indrig_con">
						<div class="zizh_menubox">
							<!--选项卡标题开始-->
							<ul class="clearfix">
								<li class="active" id="two1" onclick="setTab('two',1,2)">角色列表</li>
								<li id="two2" onclick="setTab('two',2,2)">子账号列表</li>
							</ul>
						</div>
						<div class="zizh_conbox">
							<!--选项卡内容开始-->
							<div class="zizh_con_1" style="display:block;" id="con_two_1">
								<table class="zizh_table1">
									<thead>
										<tr>
											<th class="w_20">角色名称</th>
											<th class="w_20">角色类型</th>
											<th class="w_60">角色描述</th>
										</tr>
									</thead>
									<tbody id="tbody">
										<tr>
											<td>高级管理员</td>
											<td>系统管理员</td>
											<td>最高权限,拥有所有功能的操作</td>
										</tr>
										<tr>
											<td>管理员</td>
											<td>系统内置</td>
											<td>功能暂时和主账号一样</td>
										</tr>
										<tr>
											<td>财务</td>
											<td>系统内置</td>
											<td>财务，可以查看报表和明细</td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="zizh_con_2" style="display:none;" id="con_two_2">
								{if session('user_type') == 1}
								<div class="zizh_btnbox">
									<button class="zizh_btn" type="button"><i class="iconfont icon-jia"></i>新增子账号</button>
								</div>
								{/if}
								<table class="zizh_table1 zizh_table2">
									<thead>
										<tr>
											<th class="w_20">创建时间</th>
											<th class="w_20">所属角色</th>
											<th class="w_25">姓名</th>
											<th class="w_15">帐号</th>
											<th class="w_10">状态</th>
											<th class="w_10">操作</th>
										</tr>
									</thead>
									<tbody id="tbody">
										{volist name="list" id="ad" empty="$empty"}
										<tr>
											<td>{$ad.add_time}</td>
											<td>
												{if $ad.user_type==2} 管理员 {else if $ad.user_type==3} 财务 {/if}

											</td>
											<td>{$ad.user_name}</td>
											<td>{$ad.mobile}</td>
											<td>{if $ad.status==1} 正常 {else} 冻结 {/if}
											</td>
											<td>
												<a href="#" onclick="open_edit('{$ad.id}')">编辑</a>
											</td>
										</tr>
										{/volist}
									</tbody>
								</table>
							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
		<script>
			$(".zizh_btn").click(function() {
				layer.open({
					type: 2,
					title: '增加子账号',
					shadeClose: true,
					shade: 0.8,
					area: ['500px', '420px'],
					content: "{:url('index/add_account')}"
				});
			})

			function open_edit(id) {
				var url = 'edit_account?id=' + id;
				layer.open({
					type: 2,
					title: '编辑账号',
					shadeClose: true,
					shade: 0.8,
					area: ['500px', '420px'],
					content: [url]
				});
			}

			function setTab(name, cursel, n) {
				for(i = 1; i <= n; i++) {
					var menu = document.getElementById(name + i);
					var con = document.getElementById("con_" + name + "_" + i);
					menu.className = i == cursel ? "hover" : "";
					con.style.display = i == cursel ? "block" : "none";
				}
			}
		</script>
	</body>

</html>